from django.conf.urls.defaults import *
from django_book.models import Book
from django.views.generic import list_detail
from django.contrib import admin
import os

admin.autodiscover()

urlpatterns = patterns('',
    # Uncomment this for admin:
     (r'^admin/(.*)', admin.site.root),
     (r'^comments/', include('django.contrib.comments.urls')),
     (r'^books/$', list_detail.object_list, dict(queryset=Book.objects.all())),
     (r'^books/(?P<object_id>\d+)/$', list_detail.object_detail, dict(queryset=Book.objects.all())),
     (r'^images/(?P<path>.*)$', 'django.views.static.serve', {'document_root':  \
                                                os.path.join(os.path.dirname(__file__),'site_media/images')}),
)
